package com.zjol

/**
  * Created by Administrator on 2017/3/27.
  */
class Teacher {
   var name:String=_
   private  var age=27
   private [this] val  gender="male"
  def  this(name:String){
    this
    this.name=name
  }

  def  sayHello(): Unit ={
    println(this.name+":"+this.age+":"+this.gender)
  }

}

object Teacher{
  def main(args: Array[String]): Unit = {

     val teacher=new Teacher()
    teacher.name="zhaochao"
    teacher.sayHello()

  }
}




